package com.lh.glorypavilion.exception;

import com.lh.glorypavilion.result.ResultCode;
import lombok.Data;

/**
 * 自定义异常处理
 */
@Data
public class glorypavilionEx extends RuntimeException {

    private Integer code;

    public glorypavilionEx(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public glorypavilionEx(ResultCode resultCode) {
        super(resultCode.getMessage());
        this.code = resultCode.getCode();
    }

    @Override
    public String toString() {
        return "glorypavilionEx{" +
                "code=" + code +",msg="+this.getMessage()+
                '}';
    }
}
